Some methods to resize an original image are well-known, such as a nearest neighbor interpolation, a bi-linear interpolation, a bi-cubic convolution, and an average pixel method.
In the nearest neighbor interpolation, a target pixel of the resized image corresponds to the coordinates of the pixel of the original image having real numbers rather than integers. The gray scale of the original image pixel nearest to the target pixel is selected as the gray scale of the target pixel of the resized image. The nearest neighbor interpolation, while the edge of the resized image sometimes becomes jagged, is advantageous in that a higher speed computation is available.
The bi-linear interpolation linearly interpolates a gray scale of a given pixel of the resized image, based on the gray scales of four original pixels surrounding the given pixel. Therefore, the gray scale of the given pixel is calculated.
The bi-cubic convolution, which performs interpolation with a higher precision than the bi-linear interpolation, uses a cubic function based on the gray scales of 16 original pixels surrounding the target pixel (see Japanese Patent Application Publication No. 2004-102904).
The average pixel method is an algorithm dedicated to average the gray scales of the pixels with consideration a ratio of the reduced area to the original image area, and then generate the gray scales of pixels constituting the reduced image data. The image reduced by the average-pixel method has a higher quality than images reduced by other interpolation.
Japanese Patent Application Publication No. 2003-256827 discloses an average-pixel method which first enlarges the size of an original image to the size of the least common multiple with the reduced image size, and then averages the gray scales of the pixels.
The methods described above are properly selected depending on priorities such as a image quality and a processing speed.
When an image processing device processes image information, the information of an original image is required to be stored in the memory prior to the processing. If the all information for one image or all the images for one page is stored simultaneously therein, the memory has to have a large storage capacity, which may result in that the manufacturing cost of the image processing device becomes expensive.
FIG. 1 shows a flowchart for a conventional printing process. First, all image data for one page of an original image to be printed is stored into the buffer (S1). The image data includes three gray scales of red, green, and blue (RGB) for each pixel. For example, the image data captured by the digital camera is compressed into a JPEG format and stored in the memory. The compressed image data is decoded to a bitmap format on a line basis (in a horizontal direction) and then stored in the buffer.
Next, the image processing for resizing the original image is performed according to the image data stored in the buffer (S2). Generally, the average-pixel method is employed for reducing the original image. The bi-cubic convolution is employed for enlarging the original image.
The resizing process further determines the RGB values for each target pixel. The RGB values are then converted into the respective cyan, magenta, yellow, and black (CMYK) values for printing (S3), and sent to the printing section after a halftone process (S4).
The conventional method thus requires a large storage capacity for the buffer. In addition, when an image processing device is a printer to print on a recording medium, the printing is generally performed after all of the image is processed. Such procedure causes the disadvantage that a long time is needed for the printing.
Therefore, an object of the present invention is to provide an image processing device for resizing an original image in a proper manner depending on a storage capacity of a buffer used for storing the original image.